<?php
require_once("./lib/ablib.inc");
require_once("./lib/pstools.inc");

$url = "broadvision.clearvale.com";

var_dump(get_headers($url));

$fp = fsockopen($url, 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: $url\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}

//$url_info = get_url_info($url);

//var_dump($url_info);

/*
$params = '-E -H -k -K -p -e robots=off -P ';
$folder = dirname(__FILE__).'\\urls';
$params .= $folder;
$command = dirname(__FILE__).'\\tools\\wget.exe '.$params.' --no-check-certificate '.$url;
echo $command;
echo '<br/>';
$result = PsExecute($command, 30);
if ($result === false) {
    echo "Download failed!";
} else {
    echo "Downloaded!";
}
*/
//exec($command);